<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<html>
<head>
    <title>短信推送</title>
    <%@include file="../include/commonFile.jsp" %>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/ui/activity/publish_form.css">
    <style type="text/css">
        .index-outside {
            min-height: auto !important;
        }

        .index-outside > section .section-main {
            min-width: auto !important;
        }
    </style>
</head>
<body>
<div class="index-outside">
    <!--内容-->
    <section class="no-fix">
        <div class="section-main">
            <!-- 正文请写在这里 -->
            <div class="add-form-content">
                <form id="myForm" class="layui-form mt20" method="post" action="${ctx}/activityMultiple/zcActivity/sendAndSave.do">
                    <input type="hidden" name="targetId" value="${targetId}"/>
                    <input type="hidden" name="projectIds" value="${projectIds}"/>
                    <input type="hidden" name="activityId" value="${activityId}"/>
                    <input type="hidden" name="eventId" value="${eventId}"/>
                    <div class="layui-form-item">
                        <label class="layui-form-label">模板配置<span class="f-verify-red">*</span></label>
                        <div class="layui-input-block">
                            <textarea name="template" placeholder="模板配置" lay-verify="template" class="layui-textarea"
                                style="width: 85%" maxlength="200" onchange="this.value=this.value.substring(0, 300)"
                                onkeydown="this.value=this.value.substring(0, 300)" onkeyup="this.value=this.value.substring(0, 300)"
                            ></textarea>
                            <div class="layui-form-mid layui-word-aux">最多200字符</div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">说明：</label>
                        <p class="pt10">{user} 表示众筹者, {project} 表示众筹名称, {favorerNum} 表示支持人数，{actualAmount} 表示筹集资金</p>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">模板：</label>
                        <span class="content">{user} ，还有1天〔创投戈壁行〕众筹将截止，众勇士将在5天后敦煌集结。走在荒无人烟的茫茫戈壁上，你会为自己而感到，而骄傲，甚至自豪！</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="height: 30px">内容：</label>
                        <span class="content">王小雪 ，还有1天〔创投戈壁行〕众筹将截止，众勇士将在5天后敦煌集结。走在荒无人烟的茫茫戈壁上，你会为自己而感到，而骄傲，甚至自豪！</span>
                    </div>
                </form>
            </div>
        </div>
    </section>
</div>

<script type="text/javascript">
    function doSubmit() {
        var result = true;

        var template = $('textarea[name=template]').val();
        if (!template || !template.trim()) {
            util.layerMsgError("请填写模板配置");
            result = false;
            return result;
        }
        $.ajax({
            type: 'POST',
            async: false, // 使用同步的方法
            data: $('#myForm').serialize(),
            dataType: 'json',
            success: function (res) {
                if (res.success) {
                    util.layerMsgSuccess("发送成功")
                } else {
                    util.layerMsgError(res.description)
                    result = false;
                }
            },
            url: $("#myForm").attr('action')
        });
        return result;
    }
</script>
</body>
</html>
